def lengthOfLongestSubstring(strs):
    result = []
    min_size = 0
    for ch in strs:
        if ch not in result:
            result.append(ch)
        else:
            index = result.index(ch)
            for i in range(index+1):
                result.pop(0)
            result.append(ch)
        if len(result)>min_size:
            min_size = len(result)
    return min_size

def lengthOfLongestSubstring1( s: str) -> int:
    # 哈希集合，记录每个字符是否出现过
    occ = set()
    n = len(s)
    # 右指针，初始值为 -1，相当于我们在字符串的左边界的左侧，还没有开始移动
    rk, ans = -1, 0
    for i in range(n):
        if i != 0:
            # 左指针向右移动一格，移除一个字符
            occ.remove(s[i - 1])
        while rk + 1 < n and s[rk + 1] not in occ:
            # 不断地移动右指针
            occ.add(s[rk + 1])
            rk += 1
        # 第 i 到 rk 个字符是一个极长的无重复字符子串
        ans = max(ans, rk - i + 1)
    return ans

def lengthOfLongestSubstring1(strs):
    n = len(strs)
    for i in range(n):
        while strs[i]
    return min_size
# print(lengthOfLongestSubstring1("abcabcbb"))
# print(lengthOfLongestSubstring1("pwwkew"))
print(lengthOfLongestSubstring1("bbbbb"))